<html>
<!--



Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License

-->
<head>
  <link href="default.css" rel="stylesheet" type="text/css"/>
</head>
<script type="text/javascript">
  function removeHiddenFieldAndSubmit() {
    // remove the hidden field
    var el = document.getElementById("hidden_field");
    el.parentNode.removeChild(el);

    // submit the form
    document.getElementById("theForm").submit();
  }
</script>
<body>
start header
<div id="header">
  <div id="logo">
    <h1>Sitebricks</h1>

    <h2>a fast, light web framework from Google</h2>
  </div>
  <div id="menu">
    <ul>
      <li class="active"><a href="http://code.google.com/p/google-sitebricks">Google Sitebricks</a>
      </li>

      <li><a href="http://google-sitebricks.googlecode.com/svn/trunk">source</a></li>
      <li><a href="http://code.google.com/p/google-sitebricks/wiki/list">doc</a></li>
      <li><a href="http://code.google.com/p/google-guice">guice</a></li>
    </ul>
  </div>
</div>

<div id="page">
  <!-- start content -->
  <div id="content">
    <div class="post">
      <h1 class="title">examples</h1>

      <div class="entry">

        The following demonstrates a form with HTTP PUT method simulated via a hidden field..
        <br/><br/>

        <form id="theForm" method="post">

          <input id="hidden_field" type="hidden" name="__sitebricks__action" value="put"/>
          <input name="text" type="text" value="${text}"/>

          <input id="put" type="submit" value="PUT"/>
          <input type="button" onclick="removeHiddenFieldAndSubmit()()" value="POST"/>
        </form>

        <br/>
        Hint: POST button removes hidden field via javascript and then submits normally via POST
        <br/>
        Bound:
        <p id="boundText">
          textfield: ${text}
        </p>
        Message: <span id="putMessage">${putMessage}</span>
      </div>


      <div class="meta">
        <p class="byline">Google Sitebricks.</p>
      </div>
    </div>
  </div>
</div>

</body>
</html>
